
<include file="Index/header" />
<body>

<div id="wrapper">

    <include file="Index/nav"/>
    <!--/. NAV TOP  -->
    <nav class="navbar-default navbar-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">
                <li>
                    <a href="{:U('Config/index')}" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>系统设置</a>
                </li>
                <li>
                    <a href="{:U('Manager/index')}" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>管理员管理</a>
                </li>
                <li>
                    <a href="{:U('Teacher/index')}" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>教师管理</a>
                </li>
                <li>
                    <a href="{:U('Student/index')}" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>学生管理</a>
                </li>
                <li>
                    <a href="{:U('Class/index')}" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>班级管理</a>
                </li>
                <li>
                    <a href="{:U('Course/index')}" class="active-menu waves-effect waves-dark"><i class="fa fa-sitemap"></i>课程管理</a>
                </li>
                <!--<li>-->
                    <!--<a href="{:U('Share/index')}" class="waves-effect waves-dark"><i class="fa fa-sitemap"></i>共享资料管理</a>-->
                <!--</li>-->
            </ul>

        </div>

    </nav>
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper">

        <div class="container-fluid">

            <!-- Page Heading -->
            <div class="row">
                <div class="col-lg-12">

                    <ol class="breadcrumb">
                        <li>
                            <i class="fa fa-dashboard"></i>
                            <a href="{:U('Course/index')}">课程管理</a>
                        </li>
                        <li class="active">
                            <i class="fa fa-edit"></i> 添加
                        </li>
                    </ol>
                </div>
            </div>
            <!-- /.row -->

            <div class="row">
                <div class="col-lg-6">

                    <form class="form-horizontal" id="singcms-form">
                        <div class="form-group">
                            <label for="inputcno" class="col-sm-2 control-label">课号:</label>
                            <div class="col-sm-5">
                                <input type="text" name="cno" class="form-control" id="inputcno" placeholder="请填写课号">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="inputcname" class="col-sm-2 control-label">课程名:</label>
                            <div class="col-sm-5">
                                <input type="text" name="cname" class="form-control" id="inputcname" placeholder="请填写课程名"/>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="file_upload" class="col-sm-2 control-label">课程封面:</label>
                            <div class="col-sm-5">
                                <input id="file_upload"  type="file">
                                <img style="display: none" id="upload_org_code_img" src="" width="150" height="150">
                                <input id="file_upload_image" name="pic" type="hidden" value="">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="selecttname" class="col-sm-2 control-label">任课老师:</label>
                            <div class="col-sm-5">
                                <select class="form-control" name="tid" id="selecttname" style="height:44px;">
                                    <foreach name="teachers" item="t">
                                        <option value="{$t.t_id}">{$t.realname}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="button" class="btn btn-primary" id="singcms-button-submit">提交</button>
                            </div>
                        </div>
                    </form>


                </div>

            </div>
            <!-- /.row -->

        </div>
        <!-- /.container-fluid -->

    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->
<!-- Morris Charts JavaScript -->

<script>
    var SCOPE = {
        'save_url' : '/Admin/Course/add',
        'jump_url' : '/Admin/Course',
        'ajax_upload_image_url' : '/Admin/Upload/ajaxuploadimage',
        'ajax_upload_swf' : '__JS__/uploadify/uploadify.swf',
    }
</script>
<script type="text/javascript" src="__JS__/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript" src="__JS__/image.js"></script>
<script>
    $('#inputcno').blur(function () {
        var reg_cno = /^[0-9a-zA-Z]*$/g;
        var val = $(this).val();
        if(val==''){
            layer.tips('课号不能为空', ":input[name='cno']");
            return false;
        }
        if(val && !reg_cno.test(val)){
            layer.tips('课号由字母或数字组成', ":input[name='cno']");
            return false;
        }
    });
    $('#inputcname').blur(function () {
        var val = $(this).val();
        if(val==''){
            layer.tips('课程名不能为空', ":input[name='cname']");
            return false;
        }
    });
</script>
<include file="Index/footer" />





